#include "../includes/json.h" 
#include "../includes/libalgorithm_io.h" 
#include "../includes/libio.h" 

using namespace std;

int main(int argc, char** argv)
{
    vector<BusLine> busLines;
    cout << BusSystem::routes.size() << endl;
    // 将json文件中的线路图赋值到algorithm里面
    IO::readFromJsonFile2Algorithm(busLines);  
    
    // 功能测试：查询线路
    BusSystem::printRoutes();
    BusSystem::algorithm::queryBusLineDetails();
    BusSystem::algorithm::queryRoutesBetweenStops();

    // 功能测试：增加线路
    StructNewLine addednewLine
    {
        addednewLine.line_name = "12345",
        addednewLine.first_bus_time = "08:00",
        addednewLine.last_bus_time = "08:30",
        {{"123", 1},{"321", 2},{"222", 3},{"555", 4}}
    };
    IO::admin::write2JsonbyLine(addednewLine);

    //  功能测试：增加站点
    // // StructNewStation addedNewStation
    // // {
    // //     addedNewStation.busline = "101",
    // //     addedNewStation.last_station = "新模范马路站",
    // //     addedNewStation.next_station = "玄武门站",
    // //     addedNewStation.new_station = "ttt",
    // //     addedNewStation.last_time = 11,
    // //     addedNewStation.next_time = 22
    // // };
    // // IO::admin::write2JsonbyStation(addedNewStation);

    
    // 功能测试：删除站点
    // IO::admin::deleteFromJsonbyStation("101","1");

    // 功能测试：删除路线
    // IO::admin::deleteFromJsonbyLine("101");

    return 0;
}